<!DOCTYPE html>
<html class="iframe-h">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>打印中心</title>
    <link rel="stylesheet" type="text/css" href="../../static/layui/css/layui.css" media="all"/>

    <link rel="stylesheet" type="text/css" href="../../static/layui_admin/css/admin.css"/>
    <style type="text/css">
        .select-demo {
            background: #444444 0px 0px;
            color: #ffffff;
            font-size: 14px;
            border: #000000 1px solid;
            padding: 5px;
        }

        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px 5px 10px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            height: 50px;
            width: 300px;
        }

        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }
    </style>

    <script>
    var UserName = '{{ g.current_userphone }}'      ;      // 后端数据
    var time_now = '{{ now }}';
    var error = '{{ error }}';

    if (error === '1') {
        $(function () {
            $.alert("此文件不能被系统转换处理，请重试", "警告")
        });
    }
</script>

</head>

<body class="iframe-h">

<div class="wrap-container email-wrap clearfix">
    <div class="row">
        {% if current_user.Role == 'admin' %}
        <div class="email-edge col-lg-2">
            <button class="layui-btn layui-btn-normal email-write-btn" id="write-email-btn">打印中心</button>
            <dl class="email-folder">
                <dt>打印历史</dt>
                {% for i in datas %}
                <dd>
                    {% if i.File_Dir[-3:] == 'pdf' %}
                    <a href='#'
                       onclick="window.open('look/viewer.html?file=../../static/Upload_Files/{{ i.File_Dir }}','PDF','width:50%;height:50%;top:100;left:100;');">
                        {{ i.File_Name[:-4] }}{{ i.File_Dir[-4:] }}
                    </a>
                    {% endif %}
                    {% if i.File_Dir[-3:] != "pdf" %}
                    <a href="look_picture/{{ i.File_Dir }}">
                        {{ i.File_Name[:-4] }}{{ i.File_Dir[-4:] }}
                    </a>
                    {% endif %}
                </dd>
                {% endfor %}
            </dl>

        </div>
        {% endif %}
        {% if current_user.Role == 'guest' %}
        <div class="email-edge col-lg-2">
            <button class="layui-btn layui-btn-normal email-write-btn" id="write-email-btn">打印中心</button>
            <dl class="email-folder">
                <dt>打印历史</dt>
                {% for i in user_datas %}
                <dd>
                    {% if i.File_Dir[-3:] == 'pdf' %}
                    <p style="width: auto">
                        {{ i.File_Name[:-4] }}{{ i.File_Dir[-4:] }}
                    </p>
                    {% endif %}
                    {% if i.File_Dir[-3:] != "pdf" %}
                    <p style="width: auto">
                        {{ i.File_Name[:-4] }}{{ i.File_Dir[-4:] }}
                    </p>
                    {% endif %}
                </dd>
                {% endfor %}
            </dl>

        </div>
        {% endif %}
        <div class="col-lg-10">
            <div class="email-content">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                    <legend>文件上传</legend>
                </fieldset>

                <form method="post" enctype='multipart/form-data' action="{{ url_for('printer.select') }}">
                {{ form.hidden_tag() }}

                    <label class="layui-form-label">文件上传</label>
                    <!--							<input class="file input" type="file" />-->
                    {{ form.print_file(class="file input") }}
                    {% for message in form.print_file.errors %}
                    <small>{{ message }}</small>
                    {% endfor %}
                    <br/><br/><br/>

                    <label class="layui-form-label">打印点</label>
                    <div class="layui-input-block">

                        {{ form.print_place(class="select-demo") }}
                        {% for message in form.print_place.errors %}
                        <small>{{ message }}</small>
                        {% endfor %}
                    </div>
                    <br/>

                    <label class="layui-form-label">打印需求</label>
                    <div class="layui-input-block">

                        {{ form.print_demand(class="select-demo") }}
                        {% for message in form.print_demand.errors %}
                        <small>{{ message }}</small>
                        {% endfor %}
                    </div>
                    <br/>

					<label class="layui-form-label">打印份数</label>
                        <div class="layui-input-block">

                            {{ form.print_copies }}
                            {% for message in form.print_copies.errors %}
                                <small>{{ message }}</small>
                            {% endfor %}
                        </div>
					<br/>

                    <label class="layui-form-label">排版方向</label>
                    <div class="layui-input-block">
						{{ form.print_type(class="select-demo") }}
                            {% for message in form.print_type.errors %}
                                <small>{{ message }}</small>
                            {% endfor %}
                    </div>
                    <br/>
                    <div class="layui-form-item">
                        <label class="layui-form-label">纸张大小</label>
                        <div class="layui-input-block">
							{{ form.print_size(class="select-demo") }}
                            {% for message in form.print_size.errors %}
                                <small>{{ message }}</small>
                            {% endfor %}
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">打印格式</label>
                        <div class="layui-input-block">
                            {{ form.print_way(class="select-demo") }}
                            {% for message in form.print_way.errors %}
                                <small>{{ message }}</small>
                            {% endfor %}
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">色彩样式</label>
                        <div class="layui-input-block">
							{{ form.print_color(class="select-demo") }}
                            {% for message in form.print_color.errors %}
                                <small>{{ message }}</small>
                            {% endfor %}
                        </div>
                    </div>

{#                    <div class="layui-form-item">#}
                        <div class="layui-input-block">
                            <button class=>
                                {{ form.submit(class="layui-btn") }}
                            </button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
{#                    </div>#}
                </form>
            </div>
        </div>
    </div>
</div>
</div>
</body>

</html>
